package com.victor.pomelo.model;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

public class Group {
	private Date cretime;

	private String description;

	@JsonProperty("nodeid")
	private Long groupid;

	private Boolean isLeaf;

	private String name;

	private Long parentid;

	private List<Resource> resources;

	private String state;

	private String updreason;

	private Date updtime;

	private List<User> users;

	public Date getCretime() {
		return cretime;
	}

	public String getDescription() {
		return description;
	}

	@JsonProperty("nodeid")
	public Long getGroupid() {
		return groupid;
	}

	public Boolean getIsLeaf() {
		return isLeaf;
	}

	public String getName() {
		return name;
	}

	public Long getParentid() {
		return parentid;
	}

	@JsonIgnore
	public List<Resource> getResources() {
		return resources;
	}

	public String getState() {
		return state;
	}

	public String getUpdreason() {
		return updreason;
	}

	public Date getUpdtime() {
		return updtime;
	}

	/**
	 * @return the users
	 */
	@JsonIgnore
	public List<User> getUsers() {
		return users;
	}

	public void setCretime(Date cretime) {
		this.cretime = cretime;
	}

	public void setDescription(String description) {
		this.description = description == null ? null : description.trim();
	}

	public void setGroupid(Long groupid) {
		this.groupid = groupid;
	}

	public void setIsLeaf(Integer isleaf) {
		this.isLeaf = isleaf == 1 ? true : false;
	}

	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	public void setParentid(Long parentid) {
		this.parentid = parentid;
	}

	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}

	public void setState(String state) {
		this.state = state == null ? null : state.trim();
	}

	public void setUpdreason(String updreason) {
		this.updreason = updreason == null ? null : updreason.trim();
	}

	public void setUpdtime(Date updtime) {
		this.updtime = updtime;
	}

	/**
	 * @param users
	 *            the users to set
	 */
	public void setUsers(List<User> users) {
		this.users = users;
	}

	@Override
	public String toString() {
		return "Group [groupid=" + groupid + ", parentid=" + parentid
				+ ", name=" + name + ", description=" + description
				+ ", isleaf=" + isLeaf + ", state=" + state + ", cretime="
				+ cretime + ", updtime=" + updtime + ", updreason=" + updreason
				+ ", users=" + users + ", resources=" + resources + "]";
	}

}